#include <stdio.h>
#include <string.h>

#define MAX_LEN 256
#define MAX_COMMANDS 128

// step 1# 拆分命令字符串为命令字数组
void split_command(const char *input, char commandList[][MAX_LEN], int *commandCount) {
    int inQuote = 0;                      // 是否在引号内
    char curCommand[MAX_LEN] = "";
    int j = 0;

    for (int i = 0; input[i]; i++) {
        char ch = input[i];

        if (ch == '"') {
            inQuote = !inQuote;          // 切换引号状态
            curCommand[j++] = ch;
            if (!inQuote) {              // 闭合引号：命令结束
                curCommand[j] = '\0';
                strcpy(commandList[*commandCount], curCommand);
                (*commandCount)++;
                j = 0;
            }
        } else if (ch == '_' && !inQuote) {
            if (j > 0) {
                curCommand[j] = '\0';
                strcpy(commandList[*commandCount], curCommand);
                (*commandCount)++;
                j = 0;
            }
        } else {
            curCommand[j++] = ch;
        }
    }

    // step 1.5# 末尾命令处理
    if (j > 0) {
        curCommand[j] = '\0';
        strcpy(commandList[*commandCount], curCommand);
        (*commandCount)++;
    }
}

int main() {
    int index;
    char input[MAX_LEN];
    char commandList[MAX_COMMANDS][MAX_LEN];
    int commandCount = 0;

    // step 2# 读取输入（整行）
    scanf("%d", &index);
    getchar(); // 清除回车
    fgets(input, MAX_LEN, stdin);
    input[strcspn(input, "\n")] = '\0'; // 去掉换行符

    // step 3# 拆分命令
    split_command(input, commandList, &commandCount);

    // step 4# 检查索引合法
    if (index < 0 || index >= commandCount) {
        printf("ERROR\n");
        return 0;
    }

    // step 5# 替换指定命令为 "******"
    strcpy(commandList[index], "******");

    // step 6# 输出拼接结果
    printf("%s", commandList[0]);
    for (int i = 1; i < commandCount; i++) {
        printf("_%s", commandList[i]);
    }
    printf("\n");

    return 0;
}
